/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.regex.Pattern;

/**
 * <p>Project: javaseapp - Reg1
 * <p>Powered by webrx On 2021-08-06 16:14:25
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Reg6 {
    public static void main(String[] args) {
        String str = "java 123 mysql";

        //判断字符串和正则模式是不是匹配
        System.out.println(str.matches("\\d"));//false

        //判断字符串中没有数字
        System.out.println(str.matches(".*\\d.*"));//true

        //判断字符串中没有3位数字
        Pattern pp = Pattern.compile("\\d{3}");
        System.out.println(pp.matcher(str).find());//true


    }
}
